#ifndef COMMON_CROW_LOGGER_H
#define COMMON_CROW_LOGGER_H

#include <crow.h>

#include "common/log/log.h"

class CrowUiLogger : public crow::ILogHandler
{
public:
    virtual void log(std::string message, crow::LogLevel level) override
    {
        switch (level)
        {
        case crow::LogLevel::Debug:
            LOG_DEBUG << message;
            break;
        case crow::LogLevel::Info:
            LOG_INFO << message;
            break;
        case crow::LogLevel::Warning:
            LOG_WARN << message;
            break;
        case crow::LogLevel::Error:
            LOG_ERROR << message;
            break;
        case crow::LogLevel::Critical:
            LOG_FATAL << message;
            break;
        }
    }
};

#endif // COMMON_CROW_LOGGER_H
